@section('meta')
    <style>
        body{background-color: #fff;}
        .modal-content{display: unset;}
        .layui-form-label {width: 100px;}
        .layui-input-block {margin-left: 138px;}
        .layui-input, .layui-textarea {width: 86%;}
        .layui-form-select .layui-edge {right: 16%;}
        .layui-form-select dl {min-width: 86%;}
        .new-table {margin: 20px 0;}
    </style>
@endsection
@include('Home.User.Common._meta')
<!----  新增： 简历  ---->
<div class="modal-content new-table" id="addNew-content2">
    <form class="layui-form modal-client-info" action="" id="form-user" lay-filter="form-user">
        <div class="modal-func-btns">
            @if($obj)
            <a href="javascript:;" class="modal-save-btn" onclick="subForm('{{route('job_resume_add',$obj->id)}}')" title="投递">投递</a>
            @else
                <a href="javascript:;" class="modal-save-btn" onclick="subForm('{{route('resume_add')}}')" title="保存"><i class="icon icon-save"></i></a>
            @endif
            <a href="javascript:location.replace(location.href);" class="modal-edit-btn" title="重置"><i class="icon icon-edit"></i></a>
        </div>
        @include('Home.User.Common._msg')
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>姓名</label>
            <div class="layui-input-block">
                <input type="text" name="name" lay-verify="required" placeholder="请输入姓名" value="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>国家区号</label>
            <div class="layui-input-block">
                <select name="country_code" id="country_code" lay-search>
                    <option value="0" disabled selected>请选择</option>
                    <option value="63">菲律宾（+ 63）</option>
                    <option value="86">中国大陆（+ 86）</option>
                    <option value="853">澳门（+ 853）</option>
                    <option value="852">香港（+ 852）</option>
                    <option value="886">台湾（+ 886）</option>
                    <option value="60">马来西亚（+ 60）</option>
                    <option value="66">泰国（+ 66）</option>
                    <option value="65">新加坡（+ 65）</option>
                    <option value="84">越南（+ 84）</option>
                    <option value="95">缅甸（+ 95）</option>
                    <option value="855">柬埔寨（+ 855）</option>
                    <option value="856">老挝（+ 856）</option>
                    <option value="62">印度尼西亚（+ 62）</option>
                    <option value="350">直布罗陀（+ 350）</option>
                    <option value="356">马耳他（+ 356）</option>
                    <option value="58">委内瑞拉（+ 58）</option>
                    <option value="504">洪都拉斯（+ 504）</option>
                    <option value="505">尼加拉瓜（+ 505）</option>
                    <option value="506">哥斯达黎加（+ 506）</option>
                    <option value="61">澳大利亚（+ 61）</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>手机</label>
            <div class="layui-input-block">
                <input type="text" name="phone" lay-verify="required" placeholder="请输入手机" value="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>电子邮箱</label>
            <div class="layui-input-block">
                <input type="text" name="email" lay-verify="required" placeholder="请输入电子邮箱" value="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">微信</label>
            <div class="layui-input-block">
                <input type="text" name="wechat" lay-verify="required" placeholder="请输入微信" value="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>性别</label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="1" title="男">
                <input type="radio" name="sex" value="2" title="女">
                <input type="radio" name="sex" value="3" title="不详" checked>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>出生年月</label>
            <div class="layui-input-block">
                <input type="text" name="birthday" id="birthday" lay-verify="required" placeholder="请输入出生年月" value="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>国籍</label>
            <div class="layui-input-block">
                <select id="nationality" name="nationality" lay-search>
                    <option value="0" disabled selected>请选择</option>
                    @foreach($country as $k => $v)
                        <option value="{{$k}}">{{$v['name']}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">现居地</label>
            <div class="layui-input-block">
                <input type="text" name="living" lay-verify="required" placeholder="请输入现居地" value="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>学历</label>
            <div class="layui-input-block">
                <select id="education" name="education">
                    <option value="0" disabled selected>请选择</option>
                    @foreach($education as $k => $v)
                        <option value="{{$k}}">{{$v['name']}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>工作经验</label>
            <div class="layui-input-block">
                <select id="experience" name="experience">
                    <option value="0" disabled selected>请选择</option>
                    @foreach($working_time as $k => $v)
                        <option value="{{$k}}">{{$v['name']}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>求职职位</label>
            <div class="layui-input-block">
                <select id="position" name="position" lay-search>
                    <option value="0" disabled selected>请选择</option>
                    @foreach($position_class as $parent1)
                        <optgroup label="{{$parent1->name}}">
                            @foreach($parent1->member as $parent2)
                                <optgroup label="└― {{$parent2->name}}">
                                    @foreach($parent2->member as $class)
                                        <option value="{{$class->id}}">&emsp;└―└― {{$class->name}}</option>
                                    @endforeach
                                </optgroup>
                            @endforeach
                        </optgroup>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>求职状态</label>
            <div class="layui-input-block">
                <select id="state" name="state">
                    <option value="0" disabled selected>请选择</option>
                    @foreach($working_state as $k => $v)
                        <option value="{{$k}}">{{$v['name']}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>期待国家</label>
            <div class="layui-input-block">
                <select id="country" name="country" lay-search>
                    <option value="0" disabled selected>请选择</option>
                    @foreach($country as $k => $v)
                        <option value="{{$k}}">{{$v['name']}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>期待月薪</label>
            <div class="layui-input-block">
                <select id="salary" name="salary">
                    <option value="0" disabled selected>请选择</option>
                    @foreach($working_salary as $k => $v)
                        <option value="{{$k}}">{{$v['name']}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="red">*</span>到岗时间</label>
            <div class="layui-input-block">
                <select id="coming" name="coming">
                    <option value="0" disabled selected>请选择</option>
                    @foreach($arrival_time as $k => $v)
                        <option value="{{$k}}">{{$v['name']}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">一句话介绍</label>
            <div class="layui-input-block">
                <textarea name="brief" placeholder="@if($obj) 一句话描述您工作经验、学历背景、技能特长、求职要求等，建议30字以上 @else 请输入内容 @endif" lay-verify="required" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">@if(!$obj)<span class="red">*</span>@endif简历附件</label>
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="file_button"><i class="layui-icon"></i>上传简历附件</button>
                <span class="layui-word-aux" id="file_preview"></span>
                <input type="hidden" name="file_id" id="file_id">
            </div>
        </div>
        @if(!$obj)
            @if(Auth::user()->type == 1)
                <div class="layui-form-item">
                    <label class="layui-form-label">指定任务归属于</label>
                    <div class="layui-input-block">
                        <label for="shareTo">
                            <input type="radio" lay-filter="shareTo" id="shareTo1" name="shareTo" value="1" title="私有"  checked>
                        </label>
                        <label for="shareTo">
                            <input type="radio" lay-filter="shareTo" id="shareTo2" name="shareTo" value="2"  title="共享全员">
                        </label>
                        <label for="shareTo" class="no-margin">
                            <input type="radio" lay-filter="shareTo" id="shareTo3" name="shareTo" title="指派给" value="3">
                            <div class="layui-inline">
                                <div class="layui-input-inline" style="width: 160px;">
                                    <select lay-filter="assign" id="assign" name="assign">
                                        <option value="0" disabled selected>请选择</option>
                                        @foreach($frame as $item)
                                            @foreach($item as $leader)
                                                <optgroup label="{{$leader->user->username}}">
                                                    <option value="{{$leader->uid}}">{{$leader->user->username}}</option>
                                                    @foreach($leader->member as $v)
                                                        <option value="{{$v->uid}}">{{$v->user->username}}</option>
                                                    @endforeach
                                                </optgroup>
                                            @endforeach
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-mid layui-word-aux fs12">（若简历{{$resume_day}}天内未开发成功签约会自动变为共享，供其他人可再二次开发)</div>
                        </label>
                    </div>
                </div>
            @else
                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-form-mid layui-word-aux fs12">（本系统将为各位合作伙伴持续保存上传简历{{$resume_out_day}}天，超过{{$resume_out_day}}天的信息会定期清理避免数据冗余，请知悉)</div>
                </div>
            @endif
        @endif
    </form>
</div>
@section('footer')
    @include('Home.User.Common._assign')
    <script>
        layui.use(['laydate','form'], function(){
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#birthday', //指定元素
                type: 'month'
            });
        });
    </script>
@endsection
@include('Home.User.Common._footer')
@include('Home.User.Common._form')